lcPaint_ImageRotate Home

Rotates raster image. Result image size (width x height) usually becomes bigger, extra space is filled with black color. In order do not display the extra space of rotated image, you have to apply clipping polygon in the lcPaint_DrawImage... functions. Use function lcPaint_ImageGetPtbuf to retrieve clipping polygon for rotated image.

 BOOL lcPaint_ImageRotate (
   HANDLE hImage,
   double Angle
 );

Parameters
hImage
  Handle to raster image object.
Angle
  Rotation angle.

Return Value

  If the function succeeds, the return value is nonzero (TRUE).

See Also

  lcPaint_ImageGetPtbuf


Code sample:
//-----------------------------------------------
LcAppDemo01::LcAppDemo01 ()
{
  ...
  m_hPtbufImage14 = 0;
}
  
//-----------------------------------------------
LcAppDemo01::~LcAppDemo01 ()
{
  ...
  lcPaint_DeletePtbuf( m_hPtbufImage14 );
}

//-----------------------------------------------
void LcAppDemo01::LoadImages ()
{
  ...
  // copy image 11, then rotate it 30 degrees CCW
  hImage2 = lcPaint_ImageAdd( 14 );
  lcPaint_ImageCopy( hImage, hImage2 );
  Ang = 30 * LC_DEG_TO_RAD;
  m_hPtbufImage14 = lcPaint_ImageGetPtbuf( hImage2, Ang ); 
  lcPaint_ImageRotate( hImage2, Ang );
  ...
}

//-----------------------------------------------
void LcAppDemo01::PaintRasters (HANDLE hLcWnd)
{
  ...
  // draw image 14 (rotated)
  hImage = lcPaint_ImageGetByID( 14 ); 
  x = x1 + H2*3.0;
  lcPaint_DrawImage2( hLcWnd, hImage, x, y1, 80, 0, 0, 0, m_hPtbufImage14 );
  ...  
}